using System;
using System.Text;
using System.Reflection;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using NBear.Common;

namespace NBear.Test.temp
{
    public interface IParent
    {
        [PrimaryKey]
        int ID { get; set; }
        int ID2 { get; set; }
    }

    public interface IMiddle : IParent
    {
        int Middle { get; set; }
        int Middle2 { get; set; }
    }

    public interface IChild : IMiddle
    {
        string Name { get; set; }
        string Name2 { get; set; }
    }

    public interface Message : IEntity
    {
        [PrimaryKey]
        int ID { get; }
        string Title { get; set; }
        string Content { get; set; }
        DateTime UpdateTime { get; set; }
    }

    [Table("Message", AdditionalInsert = "[MessageType] = 1", AdditionalWhere = "[MessageType] = 1")]
    public interface CommonMessage : Message
    {
    }

    [Table("Message", AdditionalInsert = "[MessageType] = 2", AdditionalWhere = "[MessageType] = 2")]
    public interface SpecialMessage : Message
    {
    }

    /// <summary>
    /// Summary description for TestReflection
    /// </summary>
    [TestClass]
    public class TestReflection
    {
        public TestReflection()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestPropertyInherit()
        {
            foreach (PropertyInfo pi in Util.DeepGetProperties(typeof(IChild)))
            {
                Console.WriteLine(pi.Name);
            }
        }
    }
}
